<html>
<head><meta charset="utf-8"><title>measure closure sizes · t-compiler/wg-rfc-2229 · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/index.html">t-compiler/wg-rfc-2229</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/measure.20closure.20sizes.html">measure closure sizes</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="245228558"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/measure%20closure%20sizes/near/245228558" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/measure.20closure.20sizes.html#245228558">(Jul 07 2021 at 19:13)</a>:</h4>
<p>Hey <span class="user-group-mention" data-user-group-id="1175">@WG-rfc-2229</span>, we were discussing the question of how to measure closure sizes, and <span class="user-mention" data-user-id="116122">@simulacrum</span> suggested that instead of soliciting people to send in their measurements, we may want to just run the measurements <em>ourselves</em> using crater.</p>



<a name="245228574"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/measure%20closure%20sizes/near/245228574" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/measure.20closure.20sizes.html#245228574">(Jul 07 2021 at 19:13)</a>:</h4>
<p>I'm not sure how hard that is, I've never modified crater myself, <span class="user-mention" data-user-id="116122">@simulacrum</span> can perhaps weigh in</p>



<a name="245228606"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/measure%20closure%20sizes/near/245228606" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/measure.20closure.20sizes.html#245228606">(Jul 07 2021 at 19:13)</a>:</h4>
<p><span class="user-mention" data-user-id="281950">@Aman Arora</span>, does the <code>-Z</code> flag today generate a file as output, or dump to stderr?</p>



<a name="245228619"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/measure%20closure%20sizes/near/245228619" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aman Arora <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/measure.20closure.20sizes.html#245228619">(Jul 07 2021 at 19:14)</a>:</h4>
<p>a file</p>



<a name="245228678"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/measure%20closure%20sizes/near/245228678" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aman Arora <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/measure.20closure.20sizes.html#245228678">(Jul 07 2021 at 19:14)</a>:</h4>
<p>so we have just collect all closure_profile_*.csv</p>



<a name="245228787"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/measure%20closure%20sizes/near/245228787" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/measure.20closure.20sizes.html#245228787">(Jul 07 2021 at 19:15)</a>:</h4>
<p>OK. We <em>may</em> find it easier if we dump it to stdout, though we could readily do that at the end of process.</p>



<a name="245228807"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/measure%20closure%20sizes/near/245228807" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/measure.20closure.20sizes.html#245228807">(Jul 07 2021 at 19:15)</a>:</h4>
<p>Just beacuse that data is then collected in the logs, which I guess we can scrape.</p>



<a name="245229685"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/measure%20closure%20sizes/near/245229685" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/measure.20closure.20sizes.html#245229685">(Jul 07 2021 at 19:22)</a>:</h4>
<p>I am going to write up some notes later today</p>



<a name="245229691"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/measure%20closure%20sizes/near/245229691" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aman Arora <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/measure.20closure.20sizes.html#245229691">(Jul 07 2021 at 19:22)</a>:</h4>
<p>that won't be hard</p>



<a name="245229712"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/measure%20closure%20sizes/near/245229712" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aman Arora <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/measure.20closure.20sizes.html#245229712">(Jul 07 2021 at 19:23)</a>:</h4>
<p>that was for outputitng to stdout ^</p>



<a name="245229789"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/measure%20closure%20sizes/near/245229789" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/measure.20closure.20sizes.html#245229789">(Jul 07 2021 at 19:23)</a>:</h4>
<p>I don't think it'll be too hard</p>



<a name="245229831"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/measure%20closure%20sizes/near/245229831" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/measure.20closure.20sizes.html#245229831">(Jul 07 2021 at 19:23)</a>:</h4>
<p>Do we have a rough idea of how much data it is per crate?</p>



<a name="245230012"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/measure%20closure%20sizes/near/245230012" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aman Arora <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/measure.20closure.20sizes.html#245230012">(Jul 07 2021 at 19:25)</a>:</h4>
<p>Most crates under 100 lines</p>



<a name="245230147"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/measure%20closure%20sizes/near/245230147" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aman Arora <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/measure.20closure.20sizes.html#245230147">(Jul 07 2021 at 19:26)</a>:</h4>
<p>Cargo serde syn were all closer to 50 than 100</p>



<a name="245230329"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/measure%20closure%20sizes/near/245230329" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aman Arora <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/measure.20closure.20sizes.html#245230329">(Jul 07 2021 at 19:27)</a>:</h4>
<p>compiler + stdlib + rustdoc + any dependencies that we have from <a href="http://crates.io">crates.io</a> were together &lt; 20k lines</p>



<a name="245254196"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/measure%20closure%20sizes/near/245254196" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/measure.20closure.20sizes.html#245254196">(Jul 07 2021 at 23:13)</a>:</h4>
<p>oh that sounds very small, great</p>



<a name="245254330"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/measure%20closure%20sizes/near/245254330" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/measure.20closure.20sizes.html#245254330">(Jul 07 2021 at 23:14)</a>:</h4>
<p>I think in that case I would just dump to stdout with a known prefix (e.g., e93ae495ec -- we'll need to grep for it) before each line.</p>
<p>It probably makes sense to try and include the number of records so that we know we missed stuff, too</p>



<a name="245254347"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/measure%20closure%20sizes/near/245254347" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/measure.20closure.20sizes.html#245254347">(Jul 07 2021 at 23:15)</a>:</h4>
<p>stderr might actually work better</p>



<a name="245254453"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/measure%20closure%20sizes/near/245254453" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/measure.20closure.20sizes.html#245254453">(Jul 07 2021 at 23:16)</a>:</h4>
<p>but you can do a mini-crater with a high priority to test the idea -- <a href="https://github.com/rust-lang/crater/blob/master/docs/bot-usage.md#available-crate-selections">https://github.com/rust-lang/crater/blob/master/docs/bot-usage.md#available-crate-selections</a> with list:cargo or something might work well. I think we'll only want to emit on workspace crates, we can probably look for cap-lints to figure out when to emit or so.</p>



<a name="245254515"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/measure%20closure%20sizes/near/245254515" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/measure.20closure.20sizes.html#245254515">(Jul 07 2021 at 23:17)</a>:</h4>
<p>once we have a run done, we can use the all logs tarball to easily get the logs and analyze them as needed; see the available tarballs for the last beta run here - <a href="https://crater-reports.s3.amazonaws.com/beta-1.54-1/downloads.html">https://crater-reports.s3.amazonaws.com/beta-1.54-1/downloads.html</a> -- those will be available for your runs too.</p>



<a name="245254546"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/measure%20closure%20sizes/near/245254546" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/measure.20closure.20sizes.html#245254546">(Jul 07 2021 at 23:17)</a>:</h4>
<p><span class="user-mention" data-user-id="281950">@Aman Arora</span> With this we shouldn't have to modify crater at all which will streamline the process a lot</p>



<a name="245254602"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/measure%20closure%20sizes/near/245254602" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/measure.20closure.20sizes.html#245254602">(Jul 07 2021 at 23:18)</a>:</h4>
<p>if we do end up needing to modify it, my guess is the easy thing will be to temporarily bump the limits of lines/bytes emitted per log up, and then we can just go with this. That would be nearly trivial.</p>



<a name="245254618"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/measure%20closure%20sizes/near/245254618" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/measure.20closure.20sizes.html#245254618">(Jul 07 2021 at 23:18)</a>:</h4>
<p>Let me know if I can provide further hints/help here!</p>



<a name="245266839"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/measure%20closure%20sizes/near/245266839" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aman Arora <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/measure.20closure.20sizes.html#245266839">(Jul 08 2021 at 02:43)</a>:</h4>
<p>I'll try this tomorrow, thanks</p>



<a name="245618936"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/measure%20closure%20sizes/near/245618936" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aman Arora <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/measure.20closure.20sizes.html#245618936">(Jul 11 2021 at 17:55)</a>:</h4>
<p><span class="user-mention silent" data-user-id="281950">Aman Arora</span> <a href="#narrow/stream/189812-t-compiler.2Fwg-rfc-2229/topic/measure.20closure.20sizes/near/245230147">said</a>:</p>
<blockquote>
<p>Cargo serde syn were all closer to 50 than 100</p>
</blockquote>
<p>I think I confused some stat within the closure profile to the actual numbers. cargo is closer to 2k lines of output, serder_derive was 150ish</p>



<a name="245702432"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/measure%20closure%20sizes/near/245702432" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/measure.20closure.20sizes.html#245702432">(Jul 12 2021 at 15:26)</a>:</h4>
<p><span class="user-mention" data-user-id="281950">@Aman Arora</span> did you mean -Zprofile-closures on both start and end toolchains for <a href="https://github.com/rust-lang/rust/pull/87066#issuecomment-877847095">https://github.com/rust-lang/rust/pull/87066#issuecomment-877847095</a>?</p>



<a name="245702448"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/measure%20closure%20sizes/near/245702448" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/measure.20closure.20sizes.html#245702448">(Jul 12 2021 at 15:26)</a>:</h4>
<p>Or does it give comparative results?</p>



<a name="245702550"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/measure%20closure%20sizes/near/245702550" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aman Arora <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/measure.20closure.20sizes.html#245702550">(Jul 12 2021 at 15:27)</a>:</h4>
<p>-Zprofile-closures compares on its own. So it will compute the size before and size after 2229 is enabled within the same compile</p>



<a name="245702564"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/measure%20closure%20sizes/near/245702564" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/measure.20closure.20sizes.html#245702564">(Jul 12 2021 at 15:27)</a>:</h4>
<p>OK, great</p>



<a name="245702695"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/measure%20closure%20sizes/near/245702695" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/measure.20closure.20sizes.html#245702695">(Jul 12 2021 at 15:28)</a>:</h4>
<p>That should run in ~4-5 hours, I believe, and we'll see if it works then</p>



<a name="245755729"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/measure%20closure%20sizes/near/245755729" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aman Arora <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/measure.20closure.20sizes.html#245755729">(Jul 12 2021 at 21:59)</a>:</h4>
<p>So the test failed (also on master it seems)</p>
<p>One thing I realized that in our full run we'd a lot of duplicate information because we are using RUSTFLAGS. </p>
<p>Since all dependencies would also emit data, so if two crate have the same dependency the data from it will be emitted multiple times</p>



<a name="246272511"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/measure%20closure%20sizes/near/246272511" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/measure.20closure.20sizes.html#246272511">(Jul 16 2021 at 20:10)</a>:</h4>
<p>Hm</p>



<a name="246272554"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/measure%20closure%20sizes/near/246272554" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/measure.20closure.20sizes.html#246272554">(Jul 16 2021 at 20:11)</a>:</h4>
<p><a href="https://crater-reports.s3.amazonaws.com/pr-87066-1/try%238a4c071f46be56484e9723bd8f1e5eea08177963%2Brustflags=-Zprofile-closures/reg/cargo-0.54.0/log.txt">https://crater-reports.s3.amazonaws.com/pr-87066-1/try%238a4c071f46be56484e9723bd8f1e5eea08177963%2Brustflags=-Zprofile-closures/reg/cargo-0.54.0/log.txt</a> looks like it also hit the 100KB limit and might've been externally killed as a result, I'm not quite sure</p>



<a name="246272587"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/measure%20closure%20sizes/near/246272587" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/measure.20closure.20sizes.html#246272587">(Jul 16 2021 at 20:11)</a>:</h4>
<p><a href="https://github.com/rust-lang/crater/blob/master/config.toml#L32-L33">https://github.com/rust-lang/crater/blob/master/config.toml#L32-L33</a> -- looks like I remembered wrong, that's probably just coincidental</p>



<a name="246272677"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/measure%20closure%20sizes/near/246272677" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/measure.20closure.20sizes.html#246272677">(Jul 16 2021 at 20:12)</a>:</h4>
<p>In any case <span class="user-mention" data-user-id="281950">@Aman Arora</span> I'd suggest we try again, but remove everything except a hash of the location of the closure -- that'll be much smaller than the full line info debug print</p>



<a name="246272725"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/measure%20closure%20sizes/near/246272725" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aman Arora <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/measure.20closure.20sizes.html#246272725">(Jul 16 2021 at 20:12)</a>:</h4>
<p>Can we take the hash and go back to the original closure locatiot?</p>



<a name="246272732"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/measure%20closure%20sizes/near/246272732" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aman Arora <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/measure.20closure.20sizes.html#246272732">(Jul 16 2021 at 20:13)</a>:</h4>
<p>Location*</p>



<a name="246272756"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/measure%20closure%20sizes/near/246272756" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aman Arora <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/measure.20closure.20sizes.html#246272756">(Jul 16 2021 at 20:13)</a>:</h4>
<p>Also should I just skip printing if both before and after are 0?</p>



<a name="246272794"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/measure%20closure%20sizes/near/246272794" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/measure.20closure.20sizes.html#246272794">(Jul 16 2021 at 20:13)</a>:</h4>
<p>I think I'd not skip printing any closures</p>



<a name="246272803"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/measure%20closure%20sizes/near/246272803" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/measure.20closure.20sizes.html#246272803">(Jul 16 2021 at 20:13)</a>:</h4>
<p>that'll skew our results a little.</p>



<a name="246272852"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/measure%20closure%20sizes/near/246272852" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aman Arora <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/measure.20closure.20sizes.html#246272852">(Jul 16 2021 at 20:14)</a>:</h4>
<p>Fair enough</p>



<a name="246272856"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/measure%20closure%20sizes/near/246272856" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/measure.20closure.20sizes.html#246272856">(Jul 16 2021 at 20:14)</a>:</h4>
<p>We can't take the hash, but ultimately, if anything looks notable we can rerun that particular crate locally</p>



<a name="246272870"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/measure%20closure%20sizes/near/246272870" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/measure.20closure.20sizes.html#246272870">(Jul 16 2021 at 20:14)</a>:</h4>
<p>the hash is only really so we can deduplicate across crates, I think</p>



<a name="246272900"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/measure%20closure%20sizes/near/246272900" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/measure.20closure.20sizes.html#246272900">(Jul 16 2021 at 20:14)</a>:</h4>
<p>Looking at the last beta run, it seems like libc compiles fine</p>



<a name="246272958"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/measure%20closure%20sizes/near/246272958" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/measure.20closure.20sizes.html#246272958">(Jul 16 2021 at 20:15)</a>:</h4>
<p>serde_derive does too.</p>



<a name="246272976"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/measure%20closure%20sizes/near/246272976" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/measure.20closure.20sizes.html#246272976">(Jul 16 2021 at 20:15)</a>:</h4>
<p>So we might try some other crates.</p>



<a name="246273049"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/measure%20closure%20sizes/near/246273049" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aman Arora <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/measure.20closure.20sizes.html#246273049">(Jul 16 2021 at 20:16)</a>:</h4>
<p>I'm not sure if we want to deduplicate based on span. The closure can be within a generic function and then type parameters might have different sizes</p>



<a name="246273289"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/measure%20closure%20sizes/near/246273289" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/measure.20closure.20sizes.html#246273289">(Jul 16 2021 at 20:18)</a>:</h4>
<p>Hm</p>



<a name="246273302"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/measure%20closure%20sizes/near/246273302" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/measure.20closure.20sizes.html#246273302">(Jul 16 2021 at 20:18)</a>:</h4>
<p>I imagine we could put <em>something</em> in the hash to make it unique</p>



<a name="246273368"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/measure%20closure%20sizes/near/246273368" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/measure.20closure.20sizes.html#246273368">(Jul 16 2021 at 20:19)</a>:</h4>
<p>I guess ultimately it doesn't matter too much wrt to deduplication, we can likely just skip the hash too. This is really for broad analysis, which if it has duplicates will just weight more widely used projects more heavily</p>



<a name="246273373"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/measure%20closure%20sizes/near/246273373" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/measure.20closure.20sizes.html#246273373">(Jul 16 2021 at 20:19)</a>:</h4>
<p>which seems OK</p>



<a name="246273492"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/measure%20closure%20sizes/near/246273492" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aman Arora <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/measure.20closure.20sizes.html#246273492">(Jul 16 2021 at 20:20)</a>:</h4>
<p>I'd assume ty::Instance used for codegen in MIR is somewhat unique? Or deduplicated to some degree</p>



<a name="246273564"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/measure%20closure%20sizes/near/246273564" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/measure.20closure.20sizes.html#246273564">(Jul 16 2021 at 20:21)</a>:</h4>
<p>codegen would already have generics instantiated, I think, so it should be pretty close to a good thing to hash, I'd imagine</p>



<a name="246273579"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/measure%20closure%20sizes/near/246273579" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/measure.20closure.20sizes.html#246273579">(Jul 16 2021 at 20:21)</a>:</h4>
<p>(You'd want the stable hash, I believe, not the regular hash impl)</p>



<a name="246273586"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/measure%20closure%20sizes/near/246273586" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/measure.20closure.20sizes.html#246273586">(Jul 16 2021 at 20:21)</a>:</h4>
<p>cc <span class="user-mention" data-user-id="116009">@nikomatsakis</span> as well</p>



<a name="246308208"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/measure%20closure%20sizes/near/246308208" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/measure.20closure.20sizes.html#246308208">(Jul 17 2021 at 06:23)</a>:</h4>
<p>This all sounds right</p>



<a name="246483957"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/measure%20closure%20sizes/near/246483957" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aman Arora <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/measure.20closure.20sizes.html#246483957">(Jul 19 2021 at 17:15)</a>:</h4>
<p>I have pushed a change to output the stable hash. In the change i pushed I also reduced the size of the prefix a bit</p>
<p><a href="/user_uploads/4715/kQP7BE_ZqLCfq85KePtByh53/image.png">image.png</a></p>
<div class="message_inline_image"><a href="/user_uploads/4715/kQP7BE_ZqLCfq85KePtByh53/image.png" title="image.png"><img src="/user_uploads/4715/kQP7BE_ZqLCfq85KePtByh53/image.png"></a></div>



<a name="246733199"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/measure%20closure%20sizes/near/246733199" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aman Arora <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/measure.20closure.20sizes.html#246733199">(Jul 21 2021 at 15:07)</a>:</h4>
<p><span class="user-mention" data-user-id="116122">@simulacrum</span> can you restart the crater run please? Thank you</p>



<a name="246733304"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/measure%20closure%20sizes/near/246733304" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/measure.20closure.20sizes.html#246733304">(Jul 21 2021 at 15:08)</a>:</h4>
<p>will do later today</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>